Skip to content

Conversation

@tang-hi
Copy link
Contributor

@tang-hi tang-hi commented Nov 24, 2025

A minor code cleanup

refactored the loop over fieldHash in the flush method to use a for-each loop

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors a loop over the fieldHash array in the flush method from an indexed for-loop to a for-each loop, making the code more concise and idiomatic.

Key changes:

  • Replaced indexed for-loop with for-each loop for iterating over fieldHash array

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Map<String, TermsHashPerField> fieldsToFlush = new HashMap<>();
for (int i = 0; i < fieldHash.length; i++) {
PerField perField = fieldHash[i];
for (PerField perField : fieldHash) {
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this refactoring is valid, there are other identical loop patterns over fieldHash in the same file (e.g., in writePoints() at line 371 and writeDocValues() at line 409) that still use the indexed for-loop style. For consistency, consider refactoring those loops to use for-each as well, or keep all of them in the same style.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant